#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtNetwork/QTcpSocket>
#include <QDataStream>
#include <QTimer>

extern "C"{
#include "exclib/exslip.h"
}

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
 private slots:
    void tcp_dataready(void);
    void displayError(QAbstractSocket::SocketError);
    void cycletmrCtrl(bool ctrl);
    void tcp_connect(void);
    void tcp_send(void);
    void tcp_set_connected(void);
    void tcp_set_disconnected(void);
    void timer_run(void);
private:
    Ui::MainWindow *ui;
    QTimer *cycletmr;
    QTcpSocket *tcpSocket;
    bool is_tcp_connected;
    char last_command;
    int count_time;

};

#endif // MAINWINDOW_H
